package com.lanou3g.greendaodemo.entity.greendao;

import android.database.sqlite.SQLiteDatabase;

import java.util.Map;

import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.AbstractDaoSession;
import de.greenrobot.dao.identityscope.IdentityScopeType;
import de.greenrobot.dao.internal.DaoConfig;

import com.lanou3g.greendaodemo.entity.greendao.NewsScrollEntity;
import com.lanou3g.greendaodemo.entity.greendao.GridViewEntity;
import com.lanou3g.greendaodemo.entity.greendao.NewsDataEntity;

import com.lanou3g.greendaodemo.entity.greendao.NewsScrollEntityDao;
import com.lanou3g.greendaodemo.entity.greendao.GridViewEntityDao;
import com.lanou3g.greendaodemo.entity.greendao.NewsDataEntityDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see de.greenrobot.dao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig newsScrollEntityDaoConfig;
    private final DaoConfig gridViewEntityDaoConfig;
    private final DaoConfig newsDataEntityDaoConfig;

    private final NewsScrollEntityDao newsScrollEntityDao;
    private final GridViewEntityDao gridViewEntityDao;
    private final NewsDataEntityDao newsDataEntityDao;

    public DaoSession(SQLiteDatabase db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        newsScrollEntityDaoConfig = daoConfigMap.get(NewsScrollEntityDao.class).clone();
        newsScrollEntityDaoConfig.initIdentityScope(type);

        gridViewEntityDaoConfig = daoConfigMap.get(GridViewEntityDao.class).clone();
        gridViewEntityDaoConfig.initIdentityScope(type);

        newsDataEntityDaoConfig = daoConfigMap.get(NewsDataEntityDao.class).clone();
        newsDataEntityDaoConfig.initIdentityScope(type);

        newsScrollEntityDao = new NewsScrollEntityDao(newsScrollEntityDaoConfig, this);
        gridViewEntityDao = new GridViewEntityDao(gridViewEntityDaoConfig, this);
        newsDataEntityDao = new NewsDataEntityDao(newsDataEntityDaoConfig, this);

        registerDao(NewsScrollEntity.class, newsScrollEntityDao);
        registerDao(GridViewEntity.class, gridViewEntityDao);
        registerDao(NewsDataEntity.class, newsDataEntityDao);
    }
    
    public void clear() {
        newsScrollEntityDaoConfig.getIdentityScope().clear();
        gridViewEntityDaoConfig.getIdentityScope().clear();
        newsDataEntityDaoConfig.getIdentityScope().clear();
    }

    public NewsScrollEntityDao getNewsScrollEntityDao() {
        return newsScrollEntityDao;
    }

    public GridViewEntityDao getGridViewEntityDao() {
        return gridViewEntityDao;
    }

    public NewsDataEntityDao getNewsDataEntityDao() {
        return newsDataEntityDao;
    }

}
